cmake_minimum_required(VERSION 3.27)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

project(
  main
  VERSION 1.0.0
  LANGUAGES C CXX)

set(BINARY_DIR ${PROJECT_BINARY_DIR})

set(GTEST_DIR
    "D:/lib/googletest-1.14.0/lib/cmake/GTest"
    CACHE STRING "GTest dir")

set(GTEST_BINARY_DIR
    "D:/lib/googletest-1.14.0/bin"
    CACHE STRING "GTest dll dir")

set(EIGEN3_DIR
    "D:/lib/Eigen3/share/eigen3/cmake"
    CACHE STRING "Eigen3 dir")

set(OCC_DIR
    "D:/lib/opencascade-7.7.0/cmake"
    CACHE STRING "OpenCascade dir")

set(GLM_DIR
    "D:/lib/glm/cmake/glm"
    CACHE STRING "GLM dir")

set(GLFW3_DIR
    "D:/lib/GLFW/lib/cmake/glfw3"
    CACHE STRING "GLFW3 dir")

set(GLFW3_BINARY_DIR
    "D:/lib/GLFW/bin"
    CACHE STRING "GLFW3 dll dir")

set(GLAD_DIR
    "D:/lib/GLFW/glad.c"
    CACHE STRING "GLAD dir")

set(PYBIND11_DIR
    "D:/lib/pybind11/share/cmake/pybind11"
    CACHE STRING "Pybind11 dir")

set(MKL_DIR
    "D:/lib/MKL/cmake"
    CACHE STRING "MKL dir")

set(BENCHMARK_DIR
    "D:/lib/googlebenchmark-1.9.0/lib/cmake/benchmark"
    CACHE STRING "benchmark dir")

set(QT_DIR
    "D:/Qt/Qt6.6/6.6.0/msvc2019_64/lib/cmake"
    CACHE STRING "Qt dir")

file(MAKE_DIRECTORY ${BINARY_DIR}/Debug)
file(MAKE_DIRECTORY ${BINARY_DIR}/Release)
file(MAKE_DIRECTORY ${BINARY_DIR}/RelWithDebInfo)

add_definitions(-DTEST_DATA_PATH="${CMAKE_SOURCE_DIR}/data")
add_definitions(-DROOT_SOURCE_PATH="${CMAKE_SOURCE_DIR}")
add_definitions(-DUNICODE -D_UNICODE)

# 包含 CPM 脚本，添加 cmake-format 包
include("${CMAKE_SOURCE_DIR}/cmake/CPM.cmake")
cpmaddpackage(NAME cmake-format VERSION 1.7.0 SOURCE_DIR "D:/lib/Format.cmake")

add_subdirectory(src)
